import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import store from './store'
import axios from "axios";
import echarts from 'echarts'
Vue.prototype.$echarts=echarts
Vue.config.productionTip = false
axios.defaults.baseURL="http://localhost:8081/"
//请求拦截器
axios.interceptors.request.use(function (config) {
  config.headers.Authorization = window.sessionStorage.getItem('token');
  console.log("token: "+config.headers.Authorization)
  console.log("url:" + config.url)
  console.log("-------发送数据-------")
  console.dir(config.data, {depth: null});
  return config
}, function (error) {
  console.log(error)
})
//响应拦截器
axios.interceptors.response.use(function (res) {
  let data = res.data;
  console.log("-------接收数据-------")
  console.dir(data, {depth: null});
  return data;
}, function (error) {
  console.log(error);
})
new Vue({
  store,
  router,
  render: h => h(App)
}).$mount('#app')
